package com.supersonic.backend.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
@Entity
public class MessageHistory extends BaseModel{

	private String sendMobileNumber;
	
	private String receiveMobileNumber;
	
	@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
	private User from;

	@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
	private User to;

	@OneToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private MessageType type;
	
	@OneToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private ContentType contentType;

	private String content;

	@OneToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private Job relativeJob;

	private Date sendDateTime;

	private int status;

	@OneToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private MessageChannel channel;

	/**
	 * @return the from
	 */
	public User getFrom() {
		return from;
	}

	/**
	 * @param from the from to set
	 */
	public void setFrom(User from) {
		this.from = from;
	}

	/**
	 * @return the to
	 */
	public User getTo() {
		return to;
	}

	/**
	 * @param to the to to set
	 */
	public void setTo(User to) {
		this.to = to;
	}

	/**
	 * @return the type
	 */
	public MessageType getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(MessageType type) {
		this.type = type;
	}

	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @param content the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @return the relativeJob
	 */
	public Job getRelativeJob() {
		return relativeJob;
	}

	/**
	 * @param relativeJob the relativeJob to set
	 */
	public void setRelativeJob(Job relativeJob) {
		this.relativeJob = relativeJob;
	}

	/**
	 * @return the sendDateTime
	 */
	public Date getSendDateTime() {
		return sendDateTime;
	}

	/**
	 * @param sendDateTime the sendDateTime to set
	 */
	public void setSendDateTime(Date sendDateTime) {
		this.sendDateTime = sendDateTime;
	}

	/**
	 * @return the status
	 */
	public int getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(int status) {
		this.status = status;
	}

	/**
	 * @return the channel
	 */
	public MessageChannel getChannel() {
		return channel;
	}

	/**
	 * @param channel the channel to set
	 */
	public void setChannel(MessageChannel channel) {
		this.channel = channel;
	}

	/**
	 * @return the sendMobileNumber
	 */
	public String getSendMobileNumber() {
		return sendMobileNumber;
	}

	/**
	 * @param sendMobileNumber the sendMobileNumber to set
	 */
	public void setSendMobileNumber(String sendMobileNumber) {
		this.sendMobileNumber = sendMobileNumber;
	}

	/**
	 * @return the receiveMobileNumber
	 */
	public String getReceiveMobileNumber() {
		return receiveMobileNumber;
	}

	/**
	 * @param receiveMobileNumber the receiveMobileNumber to set
	 */
	public void setReceiveMobileNumber(String receiveMobileNumber) {
		this.receiveMobileNumber = receiveMobileNumber;
	}

	/**
	 * @return the contentType
	 */
	public ContentType getContentType() {
		return contentType;
	}

	/**
	 * @param contentType the contentType to set
	 */
	public void setContentType(ContentType contentType) {
		this.contentType = contentType;
	}

}
